package org.jspar.expr;

public class IntegerExpr extends Expr {
	private int value;

	public IntegerExpr(int value) {
		this.value = value;
	}

	public int eval() {
		return value;
	}

	public Expr add(Expr a) {
		return new IntegerExpr(value + a.eval());
	}

	public Expr substract(Expr a) {
		return new IntegerExpr(value - a.eval());
	}

	public Expr multiply(Expr a) {
		return new IntegerExpr(value * a.eval());
	}

	public Expr divide(Expr a)  {
		return new IntegerExpr(value / a.eval());
	}
}
